<?php

?>
<div id="dialog-promotion-code" class="hide" title="<?php echo lang('mailto_promotion_code'); ?>" >
  <h1><?php echo lang('mailto_users_newsletter'); ?></h1>
  <form id="form-promotion-code" action="javascript:void(null)"  method="post">
    <label><?=lang('from')?>:</label>
      <select name="mailto[from_id]" id="mailto_from_id" class="text middle ui-widget-content ui-corner-all">
        <option value=""></option>
        <?php 
        foreach ($users_from as $row)          
        {
          $name = ( "" != $row->name )?$row->name:$row->username;
          echo "<option value='{$row->id}'>{$name}</option>";
        }
        ?>
      </select>
    <label><?=lang('subject')?>:</label>
      <input type="text" name="mailto[subject]" id="mailto_subject" class="text middle ui-widget-content ui-corner-all" />      
    <label><?=lang('message')?>:</label>
      <textarea name="mailto[message]" id="mailto_message" class="text txtarea ui-widget-content ui-corner-all" ><?php echo lang('promo_code_message'); ?></textarea>     
      <br/>
      
      <label><?=lang('promotion_code')?></label>
      <input type="text" name="mailto[promotion_code]" id="mailto_promotion_code" class="text middle ui-widget-content ui-corner-all" disabled="disabled" /> 
      <br/><br/><br/>
      <label><?=lang('or')?></label>
      <input style='width: 20px !important;' type="checkbox" checked="checked" name="mailto[auto_code]" id="auto_code" />
      <?=lang('generate_promo_codes_auto')?>
      <br/>
      <br/>
      <div id="mail_response" ></div>
      <hr/>
    <label> &nbsp; </label>
      <input type="button" name="send_promotion_code" id="send_promotion_code" value="<?=lang('term_send')?>" class='right ui-button ui-button-text-only ui-widget ui-state-default ui-corner-all' />
 </form>
</div>